<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 李煜湾
  Date: 2020/12/22
  Time: 9:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>栏目管理</title>
    <script>
        // 确认修改信息
        function verify()
        {
            var str = confirm("是否确定修改栏目名称？");
            if(str == true)
            {
                alert("确定修改！");
            }
            else
            {
                alert("取消修改！");
            }
        }
    </script>
    <link href="${pageContext.request.contextPath}/css/style.css" rel="stylesheet" type="text/css">
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<center>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td height="25" align="center" valign="bottom" class="td06"> <table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="2%" valign="middle" background="../../images/bg_03.gif">&nbsp;</td>
                    <td width="2%" valign="middle" background="../../images/bg_03.gif"><img src="../../images/main_28.gif" width="9" height="9" align="absmiddle"></td>
                    <td height="30" valign="middle" background="../../images/bg_03.gif"><div align="left"><font color="#FFFFFF">栏目修改</font></div></td>
                </tr>
            </table></td>
        </tr>
    </table>
    <form name="form1" method="post" action="${pageContext.request.contextPath}/news/update">
        <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" class="table01">
            <tr>
                <td class="td_02">栏目名称</td>
                <!-- 显示原数据栏目信息 -->
                <td hidden ><input id="id" name="id" value="${updatePage.newsLabel.id}">${updatePage.newsLabel.id}</td>
                <td class="td_02"><input name="label_name" type="text" class="input" style="width:99% "
                                         value="${updatePage.newsLabel.label_name}"
                                            id="label_name">
                </td>
            </tr>
            <tr>
                <td class="td_02">上级栏目名称</td>
                <td class="td_02">
                    <select name="pid" style="width:99% " id="pid">
                        <!-- 显示可以选择所有父栏目，且父栏目id与此栏目的pid一致时，默认显示选中此父栏目 -->
                        <c:forEach items="${updatePage.parents}" var="parents">
                            <option value="${parents.id}"
                                    <c:if test="${parents.id==updatePage.newsLabel.pid}">
                                        selected
                                    </c:if>
                            >${parents.label_name}</option>
                        </c:forEach>
                </select></td>
            </tr>
            <tr>
                <td width="14%" class="td_02">栏目描述</td>
                <td width="86%" class="td_02">
                    <textarea name="label_content" rows="5" style="width:99% " id="label_content">${updatePage.newsLabel.label_content}</textarea>
                </td>
            </tr>
        </table>
        <br>
        <table width="95%"  border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td class="td_page">
                    <div align="center">
                    <input  type="submit" class="buttonface02" value="  修 改  " onClick="verify()">
                    <input type="reset" class="buttonface02" value="重 置">
                        <button class="buttonface02">
                            <a href="${pageContext.request.contextPath}/news/queryNewLabel">关 闭</a>
                        </button>
                    </div>
                </td>
            </tr>
        </table>
    </form>
</center>
</body>
</html>

